﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class 添加客房 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Binddate()
    {
        users us = new users();
        GridView1.DataSource = us.GetAll(us);
        GridView1.DataBind();
    }
    protected void btnL_Click(object sender, EventArgs e)
    {
        string num = txtnu.Text.Trim();
        string price = TextBox1.Text.Trim();
        string type = TextBox2.Text.Trim();
        string money = TextBox3.Text.Trim();
       // string free = TextBox4.Text.Trim();

        users tmp = new users();
        tmp.num = num;
        tmp.price = price;
        tmp.type = type;
        tmp.money = money;
       // tmp.free = free;

        int result = tmp.add(tmp);
        if (result > 0)
        {
            Response.Write("<script>alert(\"添加成功！\")</script>");
            Binddate();
        }
    }
}
